home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 2004 May / SGI IRIX 6.5 Applications 2004 May.iso / dev / java2_dev.idb / usr / java2 / lib / ir.idl.z / ir.idl
Text File  |  2004-02-24  |  18KB  |  761 lines

  1. /*
  2.  * @(#)ir.idl    1.4 01/12/03
  3.  *
  4.  * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5.  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6.  */
  7.  
  8. /*
  9.  * This file contains OMG IDL from  CORBA V2.0, July 1995.
  10.  * It also contains the TypeCode creation APIs in CORBA::ORB
  11.  **/
  12.  
  13. #pragma prefix "omg.org"
  14.  
  15. module CORBA {
  16.     typedef string Identifier;
  17.     typedef string ScopedName;
  18.     typedef string RepositoryId;
  19.  
  20.     enum DefinitionKind {
  21.     dk_none, dk_all,
  22.     dk_Attribute, dk_Constant, dk_Exception, dk_Interface,
  23.     dk_Module, dk_Operation, dk_Typedef,
  24.     dk_Alias, dk_Struct, dk_Union, dk_Enum,
  25.     dk_Primitive, dk_String, dk_Sequence, dk_Array,
  26.     dk_Repository,
  27.     dk_Wstring, dk_Fixed,
  28.     dk_Value, dk_ValueBox, dk_ValueMember, // orbos 98-01-18: Objects By Value
  29.     dk_Native
  30.     };
  31.  
  32.  
  33.     interface IRObject
  34.     /**
  35.       An IRObject IDL interface represents the most generic interface
  36.       from which all other Interface Repository interfaces are derived,
  37.       even the Repository itself.
  38.      */
  39.     {
  40.     // read interface
  41.     readonly attribute DefinitionKind def_kind;
  42.  
  43.     // write interface
  44.     void destroy ();
  45.     };
  46.  
  47.  
  48.  
  49.     typedef string VersionSpec;
  50.  
  51.     interface Contained;
  52.     interface Repository;
  53.     interface Container;
  54.  
  55.     interface Contained : IRObject
  56.     /**
  57.        The Contained Interface is inherited by all Interface Repository
  58.        interfaces that are contained by other objects.
  59.      */
  60.     {
  61.     // read/write interface
  62.  
  63.     attribute RepositoryId id;
  64.     attribute Identifier name;
  65.     attribute VersionSpec version;
  66.  
  67.     // read interface
  68.  
  69.     readonly attribute Container defined_in;
  70.     readonly attribute ScopedName absolute_name;
  71.     readonly attribute Repository containing_repository;
  72.  
  73.     struct Description {
  74.         DefinitionKind kind;
  75.         any value;
  76.     };
  77.  
  78.     Description describe ();
  79.  
  80.     // write interface
  81.  
  82.     void move (
  83.         in Container new_container,
  84.         in Identifier new_name,
  85.         in VersionSpec new_version
  86.         );
  87.     };
  88.  
  89.  
  90.     interface ModuleDef;
  91.     interface ConstantDef;
  92.     interface IDLType;
  93.     interface StructDef;
  94.     interface UnionDef;
  95.     interface EnumDef;
  96.     interface AliasDef;
  97.     interface InterfaceDef;
  98.     interface ExceptionDef;
  99.     interface ValueDef;        // orbos 98-01-18: Objects By Value
  100.     interface ValueMemberDef;    // orbos 98-01-18: Objects By Value
  101.     interface ValueBoxDef;    // orbos 98-01-18: Objects By Value
  102.     interface NativeDef;
  103.  
  104.  
  105.     typedef sequence <InterfaceDef> InterfaceDefSeq;
  106.  
  107.  
  108.     typedef sequence <Contained> ContainedSeq;
  109.  
  110.     struct StructMember {
  111.     Identifier name;
  112.     TypeCode type;
  113.     IDLType type_def;
  114.     };
  115.     typedef sequence <StructMember> StructMemberSeq;
  116.  
  117.     struct UnionMember {
  118.     Identifier name;
  119.     any label;
  120.     TypeCode type;
  121.     IDLType type_def;
  122.     };
  123.     typedef sequence <UnionMember> UnionMemberSeq;
  124.  
  125.  
  126.     typedef sequence <Identifier> EnumMemberSeq;
  127.  
  128.     // orbos 98-01-18: Objects By Value -- begin
  129.     typedef short Visibility;    
  130.     const Visibility PRIVATE_MEMBER = 0; 
  131.     const Visibility PUBLIC_MEMBER = 1;
  132.  
  133.     struct ValueMember {
  134.         Identifier name;
  135.     RepositoryId id;
  136.     RepositoryId defined_in;
  137.     VersionSpec version;
  138.         TypeCode type;
  139.         IDLType type_def;
  140.         Visibility access;
  141.     };
  142.     typedef sequence <ValueMember> ValueMemberSeq;
  143.  
  144.     struct Initializer {
  145.         StructMemberSeq members;
  146.     };
  147.     typedef sequence <Initializer> InitializerSeq;
  148.  
  149.     typedef sequence <ValueDef> ValueDefSeq;
  150.     
  151.     // orbos 98-01-18: Objects By Value -- end
  152.  
  153.  
  154.     interface Container : IRObject
  155.     /**
  156.       The Container interface is used to form a containment hierarchy
  157.       in the Interface Repository. A Container can contain any number
  158.       of objects derived from the Contained interface.
  159.     */
  160.     {
  161.     // read interface
  162.  
  163.     Contained lookup ( in ScopedName search_name);
  164.  
  165.     ContainedSeq contents (
  166.         in DefinitionKind limit_type,
  167.         in boolean exclude_inherited
  168.         );
  169.  
  170.     ContainedSeq lookup_name (
  171.         in Identifier search_name,
  172.         in long levels_to_search,
  173.         in DefinitionKind limit_type,
  174.         in boolean exclude_inherited
  175.         );
  176.  
  177.     struct Description {
  178.         Contained contained_object;
  179.         DefinitionKind kind;
  180.         any value;
  181.     };
  182.  
  183.     typedef sequence<Description> DescriptionSeq;
  184.  
  185.     DescriptionSeq describe_contents (
  186.         in DefinitionKind limit_type,
  187.         in boolean exclude_inherited,
  188.         in long max_returned_objs
  189.         );
  190.  
  191.     // write interface
  192.  
  193.     ModuleDef create_module (
  194.         in RepositoryId id,
  195.         in Identifier name,
  196.         in VersionSpec version
  197.         );
  198.  
  199.     ConstantDef create_constant (
  200.         in RepositoryId id,
  201.         in Identifier name,
  202.         in VersionSpec version,
  203.         in IDLType type,
  204.         in any value
  205.         );
  206.  
  207.     StructDef create_struct (
  208.         in RepositoryId id,
  209.         in Identifier name,
  210.         in VersionSpec version,
  211.         in StructMemberSeq members
  212.         );
  213.  
  214.     UnionDef create_union (
  215.         in RepositoryId id,
  216.         in Identifier name,
  217.         in VersionSpec version,
  218.         in IDLType discriminator_type,
  219.         in UnionMemberSeq members
  220.         );
  221.  
  222.     EnumDef create_enum (
  223.         in RepositoryId id,
  224.         in Identifier name,
  225.         in VersionSpec version,
  226.         in EnumMemberSeq members
  227.         );
  228.  
  229.     AliasDef create_alias (
  230.         in RepositoryId id,
  231.         in Identifier name,
  232.         in VersionSpec version,
  233.         in IDLType original_type
  234.         );
  235.  
  236.         ExceptionDef create_exception (
  237.             in RepositoryId    id,
  238.             in Identifier      name,
  239.             in VersionSpec     version,
  240.             in StructMemberSeq members
  241.         );
  242.  
  243.  
  244.     InterfaceDef create_interface (
  245.         in RepositoryId id,
  246.         in Identifier name,
  247.         in VersionSpec version,
  248.         in boolean is_abstract,
  249.         in InterfaceDefSeq base_interfaces
  250.         );
  251.  
  252.     // orbos 98-01-18: Objects By Value
  253.     ValueDef create_value(
  254.         in RepositoryId id,
  255.         in Identifier name,
  256.         in VersionSpec version,
  257.         in boolean is_custom,
  258.         in boolean is_abstract,
  259.         in octet flags,    // must be 0
  260.         in ValueDef base_value,
  261.         in boolean has_safe_base,
  262.         in ValueDefSeq abstract_base_values,
  263.         in InterfaceDefSeq supported_interfaces,
  264.         in InitializerSeq initializers
  265.         );
  266.     
  267.     // orbos 98-01-18: Objects By Value
  268.     ValueBoxDef create_value_box(
  269.         in RepositoryId id,
  270.         in Identifier name,
  271.         in VersionSpec version,
  272.         in IDLType original_type_def
  273.         );
  274.     
  275.     NativeDef create_native(
  276.         in RepositoryId id,
  277.         in Identifier name,
  278.         in VersionSpec version
  279.         );
  280.     
  281.     };
  282.  
  283.  
  284.  
  285.     interface IDLType : IRObject
  286.     /**
  287.        The IDLType interface is an abstract interface inherited by all
  288.        IR objects that represent the OMG IDL types. It provides access
  289.        to the TypeCode describing the type, and is used in defining the
  290.        other interfaces wherever definitions of IDLType must be referenced.
  291.     */
  292.     {
  293.     readonly attribute TypeCode type;
  294.     };
  295.  
  296.  
  297.  
  298.     interface PrimitiveDef;
  299.     interface StringDef;
  300.     interface SequenceDef;
  301.     interface ArrayDef;
  302.  
  303.     enum PrimitiveKind {
  304.     pk_null, pk_void, pk_short, pk_long, pk_ushort, pk_ulong,
  305.     pk_float, pk_double, pk_boolean, pk_char, pk_octet,
  306.     pk_any, pk_TypeCode, pk_Principal, pk_string, pk_objref
  307.     };
  308.  
  309.     interface Repository : Container
  310.     /**
  311.       Repository is an interface that provides global access to the
  312.       Interface Repository. Repository objects can contain constants,
  313.       typedefs, exceptions, interfaces, and modules.
  314.     */
  315.     {
  316.     // read interface
  317.  
  318.     Contained lookup_id (in RepositoryId search_id);
  319.  
  320.     PrimitiveDef get_primitive (in PrimitiveKind kind);
  321.  
  322.     // write interface
  323.  
  324.     StringDef create_string (in unsigned long bound);
  325.  
  326.     SequenceDef create_sequence (
  327.         in unsigned long bound,
  328.         in IDLType element_type
  329.         );
  330.  
  331.     ArrayDef create_array (
  332.         in unsigned long length,
  333.         in IDLType element_type
  334.         );
  335.     };
  336.  
  337.  
  338.     interface ModuleDef : Container, Contained
  339.     /**
  340.       A ModuleDef can contain constants, typedefs, exceptions, interfaces,
  341.       and other module objects.
  342.     */
  343.     {
  344.     };
  345.  
  346.     struct ModuleDescription {
  347.     Identifier name;
  348.     RepositoryId id;
  349.     RepositoryId defined_in;
  350.     VersionSpec version;
  351.     };
  352.  
  353.  
  354.     interface ConstantDef : Contained
  355.     /**
  356.       A ConstantDef object defines a named constant.
  357.     */
  358.     {
  359.     readonly attribute TypeCode type;
  360.     attribute IDLType type_def;
  361.     attribute any value;
  362.     };
  363.  
  364.     struct ConstantDescription {
  365.     Identifier name;
  366.     RepositoryId id;
  367.     RepositoryId defined_in;
  368.     VersionSpec version;
  369.     TypeCode type;
  370.     any value;
  371.     };
  372.  
  373.  
  374.     interface TypedefDef : Contained, IDLType
  375.     /**
  376.       TypedefDef is an abstract interface used as a base interface for
  377.       all named non-object types(structures, unions, enumerations,
  378.       aliases). The TypedefDef interface is not inherited by the definition
  379.       objects for the primitive or anonymous types.
  380.     */
  381.     {
  382.     };
  383.  
  384.     struct TypeDescription {
  385.     Identifier name;
  386.     RepositoryId id;
  387.     RepositoryId defined_in;
  388.     VersionSpec version;
  389.     TypeCode type;
  390.     };
  391.  
  392.  
  393.     interface StructDef : TypedefDef, Container
  394.     /**
  395.        A StructDef represents an OMG IDL structure definition.
  396.     */
  397.     {
  398.     attribute StructMemberSeq members;
  399.     };
  400.  
  401.  
  402.     interface UnionDef : TypedefDef, Container
  403.     /**
  404.        A UnionDef represents an OMG IDL union definition.
  405.      */
  406.     {
  407.     readonly attribute TypeCode discriminator_type;
  408.     attribute IDLType discriminator_type_def;
  409.     attribute UnionMemberSeq members;
  410.     };
  411.  
  412.  
  413.     interface EnumDef : TypedefDef
  414.     /**
  415.       A EnumDef represents an OMG IDL enum definition.
  416.      */
  417.     {
  418.     attribute EnumMemberSeq members;
  419.     };
  420.  
  421.  
  422.     interface AliasDef : TypedefDef
  423.     /**
  424.        An AliasDef represents an OMG IDL typedef that aliases other
  425.        definition.
  426.     */
  427.     {
  428.     attribute IDLType original_type_def;
  429.     };
  430.  
  431.  
  432.     interface PrimitiveDef: IDLType
  433.     /**
  434.       A PrimitiveDef represents one of the IDL primitive types. As
  435.       primitive types are unnamed, this interface is not derived from
  436.       TypedefDef or Contained.
  437.      */
  438.     {
  439.     readonly attribute PrimitiveKind kind;
  440.     };
  441.  
  442.  
  443.     interface StringDef : IDLType
  444.     /**
  445.       A StringDef represents an OMG IDL string type. As string
  446.       types are anonymous, this interface is not derived from TypedefDef
  447.       or Contained.
  448.     */
  449.     {
  450.     attribute unsigned long bound;
  451.     };
  452.  
  453.  
  454.     interface SequenceDef : IDLType
  455.     /**
  456.       A SequenceDef represents an OMG IDL sequence type. As sequence
  457.       types are anonymous, this interface is not derived from TypedefDef
  458.       or Contained.
  459.      */
  460.     {
  461.     attribute unsigned long bound;
  462.     readonly attribute TypeCode element_type;
  463.     attribute IDLType element_type_def;
  464.     };
  465.  
  466.     interface ArrayDef : IDLType
  467.     /**
  468.       An ArrayDef represents an OMG IDL array type. As array
  469.       types are anonymous, this interface is not derived from TypedefDef
  470.       or Contained.
  471.     */
  472.     {
  473.     attribute unsigned long length;
  474.     readonly attribute TypeCode element_type;
  475.     attribute IDLType element_type_def;
  476.     };
  477.  
  478.  
  479.     interface ExceptionDef : Contained, Container
  480.     /**
  481.       An ExceptionDef represents an exception definition.
  482.     */
  483.     {
  484.     readonly attribute TypeCode type;
  485.     attribute StructMemberSeq members;
  486.     };
  487.     struct ExceptionDescription {
  488.     Identifier name;
  489.     RepositoryId id;
  490.     RepositoryId defined_in;
  491.     VersionSpec version;
  492.     TypeCode type;
  493.     };
  494.  
  495.  
  496.  
  497.     enum AttributeMode {ATTR_NORMAL, ATTR_READONLY};
  498.  
  499.     interface AttributeDef : Contained
  500.     /**
  501.       An AttributeDef represents the information that defines an
  502.       attribute of an interface.
  503.     */
  504.     {
  505.     readonly attribute TypeCode type;
  506.     attribute IDLType type_def;
  507.     attribute AttributeMode mode;
  508.     };
  509.  
  510.     struct AttributeDescription {
  511.     Identifier name;
  512.     RepositoryId id;
  513.     RepositoryId defined_in;
  514.     VersionSpec version;
  515.     TypeCode type;
  516.     AttributeMode mode;
  517.     };
  518.  
  519.  
  520.  
  521.     enum OperationMode {OP_NORMAL, OP_ONEWAY};
  522.  
  523.     enum ParameterMode {PARAM_IN, PARAM_OUT, PARAM_INOUT};
  524.     struct ParameterDescription {
  525.     Identifier name;
  526.     TypeCode type;
  527.     IDLType type_def;
  528.     ParameterMode mode;
  529.     };
  530.     typedef sequence <ParameterDescription> ParDescriptionSeq;
  531.  
  532.     typedef Identifier ContextIdentifier;
  533.     typedef sequence <ContextIdentifier> ContextIdSeq;
  534.  
  535.     typedef sequence <ExceptionDef> ExceptionDefSeq;
  536.     typedef sequence <ExceptionDescription> ExcDescriptionSeq;
  537.  
  538.     interface OperationDef : Contained
  539.     /**
  540.       An OperationDef represents the information that defines an
  541.       operation of an interface.
  542.      */
  543.     {
  544.     readonly attribute TypeCode result;
  545.     attribute IDLType result_def;
  546.     attribute ParDescriptionSeq params;
  547.     attribute OperationMode mode;
  548.     attribute ContextIdSeq contexts;
  549.     attribute ExceptionDefSeq exceptions;
  550.     };
  551.  
  552.     struct OperationDescription {
  553.     Identifier name;
  554.     RepositoryId id;
  555.     RepositoryId defined_in;
  556.     VersionSpec version;
  557.     TypeCode result;
  558.     OperationMode mode;
  559.     ContextIdSeq contexts;
  560.     ParDescriptionSeq parameters;
  561.     ExcDescriptionSeq exceptions;
  562.     };
  563.  
  564.  
  565.  
  566.     typedef sequence <RepositoryId> RepositoryIdSeq;
  567.     typedef sequence <OperationDescription> OpDescriptionSeq;
  568.     typedef sequence <AttributeDescription> AttrDescriptionSeq;
  569.  
  570.     interface InterfaceDef : Container, Contained, IDLType
  571.     /**
  572.       An InterfaceDef object represents an interface definition. It can
  573.       contains constants, typedefs, exceptions, operations, and
  574.       attributes.
  575.      */
  576.     {
  577.     // read/write interface
  578.  
  579.     attribute InterfaceDefSeq base_interfaces;
  580.     attribute boolean is_abstract;
  581.  
  582.     // read interface
  583.  
  584.     boolean is_a (in RepositoryId interface_id);
  585.  
  586.     struct FullInterfaceDescription {
  587.         Identifier name;
  588.         RepositoryId id;
  589.         RepositoryId defined_in;
  590.         VersionSpec version;
  591.         boolean is_abstract;
  592.         OpDescriptionSeq operations;
  593.         AttrDescriptionSeq attributes;
  594.         RepositoryIdSeq base_interfaces;
  595.         TypeCode type;
  596.     };
  597.  
  598.     FullInterfaceDescription describe_interface();
  599.  
  600.     // write interface
  601.  
  602.     AttributeDef create_attribute (
  603.         in RepositoryId id,
  604.         in Identifier name,
  605.         in VersionSpec version,
  606.         in IDLType type,
  607.         in AttributeMode mode
  608.         );
  609.  
  610.     OperationDef create_operation (
  611.         in RepositoryId id,
  612.         in Identifier name,
  613.         in VersionSpec version,
  614.         in IDLType result,
  615.         in OperationMode mode,
  616.         in ParDescriptionSeq params,
  617.         in ExceptionDefSeq exceptions,
  618.         in ContextIdSeq contexts
  619.         );
  620.     };
  621.  
  622.     struct InterfaceDescription {
  623.     Identifier name;
  624.     RepositoryId id;
  625.     RepositoryId defined_in;
  626.     VersionSpec version;
  627.     RepositoryIdSeq base_interfaces;
  628.     };
  629.  
  630.  
  631.     // orbos 98-01-18: Objects By Value -- begin
  632.  
  633.     interface ValueMemberDef : Contained
  634.  
  635.       /** A <code>ValueMemberDef</code> object represents the public
  636.       and private data member definition of a <code>Value</code> type
  637.       */
  638.  
  639.  {
  640.         readonly attribute TypeCode type;
  641.              attribute IDLType type_def;
  642.          attribute Visibility access;
  643.     };
  644.  
  645.     interface ValueDef : Container, Contained, IDLType
  646.       /**
  647.     A ValueDef object represents the definition of the
  648.     <code>Value</code> object used to pass the object state
  649.     between hosts
  650.     */
  651.  
  652.       {
  653.        // read/write interface
  654.         attribute InterfaceDefSeq supported_interfaces;
  655.         attribute InitializerSeq initializers;
  656.         attribute ValueDef base_value;
  657.         attribute ValueDefSeq abstract_base_values;
  658.         attribute boolean is_abstract;
  659.         attribute boolean is_custom;
  660.         attribute octet flags; // always 0
  661.         attribute boolean has_safe_base;
  662.  
  663.         // read interface
  664.         boolean is_a(in RepositoryId value_id);
  665.  
  666.         struct FullValueDescription {
  667.           Identifier     name;
  668.           RepositoryId     id;
  669.           boolean     is_abstract;
  670.           boolean     is_custom;
  671.           octet         flags; // always 0
  672.           RepositoryId     defined_in;
  673.           VersionSpec     version;
  674.           OpDescriptionSeq operations;
  675.           AttrDescriptionSeq attributes;
  676.           ValueMemberSeq     members;
  677.           InitializerSeq     initializers;
  678.           RepositoryIdSeq supported_interfaces;
  679.           RepositoryIdSeq abstract_base_values;
  680.           boolean     has_safe_base;
  681.           RepositoryId    base_value;
  682.           TypeCode    type;
  683.       };
  684.  
  685.       FullValueDescription describe_value();
  686.  
  687.       // write interface
  688.  
  689.       ValueMemberDef create_value_member(
  690.           in RepositoryId id,
  691.           in Identifier name,
  692.           in VersionSpec version,
  693.           in IDLType type_def,
  694.           in Visibility access
  695.       );
  696.  
  697.       AttributeDef create_attribute(
  698.           in RepositoryId id,
  699.           in Identifier   name,
  700.           in VersionSpec  version,
  701.           in IDLType      type,
  702.           in AttributeMode mode
  703.       );
  704.  
  705.       OperationDef create_operation(
  706.           in RepositoryId id,
  707.           in Identifier   name,
  708.           in VersionSpec  version,
  709.           in IDLType      result,
  710.           in OperationMode     mode,
  711.           in ParDescriptionSeq params,
  712.           in ExceptionDefSeq   exceptions,
  713.           in ContextIdSeq contexts
  714.       );
  715.     };
  716.     struct ValueDescription {
  717.         Identifier name;
  718.         RepositoryId id;
  719.         boolean is_abstract;
  720.         boolean is_custom;
  721.         octet   flags; // always 0
  722.         RepositoryId defined_in;
  723.         VersionSpec version;
  724.         RepositoryIdSeq supported_interfaces;
  725.         RepositoryIdSeq abstract_base_values;
  726.         boolean has_safe_base;
  727.         RepositoryId base_value;
  728.     };
  729.  
  730.     interface ValueBoxDef : IDLType 
  731.  
  732.       /** ValueBoxDef is an interface that reresents a value type with
  733.     a single data member inside its state section and no
  734.     inheritance or methods. For example, when transmitting a
  735.     string or sequence as an actual parameter on an interface
  736.     operation or as a data member of a value type that is an
  737.     actual parameter, it may be important to preserve any sharing
  738.     of the string or sequence within the object graph being
  739.     transmitted. Because current IDL data types do not preserve
  740.     referential integrity in this way, this requirement is
  741.     conveniently handled by using a value type. Value types also
  742.     support the transmission of nulls (as a distinguished value),
  743.     whereas IDL data types such as string and sequence (which are
  744.     mapped to empty strings and sequences) do not. The Java to IDL
  745.     mapping requires both preservation of referential integrity
  746.     and transmission of nulls. Because it would be cumbersome to
  747.     require the full IDL syntax for a value type for this specific
  748.     usage, this shorthand notation is introduced to cover this use
  749.     of value types for simple containment of a single data member.
  750.     */
  751.  
  752. {
  753.         attribute IDLType original_type_def;
  754.     };
  755.     
  756.     // orbos 98-01-18: Objects By Value -- end
  757.  
  758.     interface NativeDef : TypedefDef {
  759.     };
  760. };
  761.